<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2008 XBRL International. All Rights Reserved. -->
<?xml-stylesheet type="text/xsl" href="../stylesheets/functionDefinition.xsl"?>
<function
  xmlns="http://xbrl.org/2008/function" 
  xmlns:reg="http://xbrl.org/2008/registry" 
  xmlns:xhtml="http://www.w3.org/1999/xhtml" 
  xmlns:xfi="http://www.xbrl.org/2008/function/instance"
  xmlns:xfie="http://www.xbrl.org/2008/function/instance/error"
  xmlns:xbrli="http://www.xbrl.org/2003/instance" 
  xmlns:xlink="http://www.w3.org/1999/xlink" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xsi:schemaLocation="
  http://xbrl.org/2008/registry ../schemas/registry.xsd
  http://xbrl.org/2008/function ../schemas/function.xsd
  ">

  <lastUpdated moment="2010-09-09T00:00:00" />

  <owners>
    <reg:owner id="herm">
       <reg:name>Herm Fischer</reg:name>
      <reg:affiliation>UBMatrix / Mark V Systems</reg:affiliation>
       <reg:email>fischer@markv.com</reg:email>
       <reg:assumedOwnership moment="2008-09-01T00:00:00" />
    </reg:owner>
  </owners>

  <summary>
    Returns a sequence containing the set of
    extended link role URIs having arcs of the subject arc role URI.
  </summary>

  <documentation>
    Extended links may be in linkbase files, schema file appinfo linkbases, and instance document footnoteLinks.
  </documentation>

  <signature name="xfi:linkbase-link-roles">

    <input name="arcrole" type="xs:string">
      <xhtml:p>
        The arcrole value that specifies the network of 
        relationships whose containing link roles are to be gathered.
      </xhtml:p>
    </input>

    <input name="xbrlinstance" type="element(xbrli:xbrl)">
      <xhtml:p>
        This parameter is optional.  If absent the target XBRL instance provides the DTS for subject linkbases.
        If provided then the specified XBRL instance provides the DTS for the subject linkbases.
      </xhtml:p>
    </input>

    <output type="xs:anyURI*">
      <xhtml:p>
        Returns an unordered sequence of the extended link role URIs that contain the subject arc role URI,
        or empty sequence if none.
      </xhtml:p>
    </output>
  </signature>

  <conformanceTest xlink:type="simple" xlink:href="90501 xfi.linkbase-link-roles testcase.xml"/>

  <revisions>
    <reg:revision on="2008-12-12T00:00:00" by="herm">
      <xhtml:p>
        Created the function definition.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2009-12-12T00:00:00" by="herm">
      <xhtml:p>
        Removed reference to dynamically loaded instances from the xbrlinstance input.
      </xhtml:p>
    </reg:revision>

    <reg:revision on="2010-09-09T00:00:00" by="herm">
      <xhtml:p>
        Changed input role URIs to strings for cast-less coding and to be similar to fn:QName's $paramURI, an xs:string.
        Note that output role URIs are still xs:anyURI, as with the built-in XPath functions returning URIs, 
        because XPath provides type-promotion from anyURI to string, not the reverse,
        (http://www.w3.org/TR/xpath20/#promotion)
        so that anyURI atomic values are usable wherever strings are expected (such as input arguments to other functions
        expecting role URIs as strings).
      </xhtml:p>
    </reg:revision>
  </revisions>

</function>
